{!! Html::style(env("APP_URL").'/assets/backend/libs/datepicker/bootstrap-datetimepicker.min.css') !!}

<div class="tabs-container">

    <div class="tab-content">
        <div id="tab-1" class="tab-pane active">

            {!! Form::open( [ 'route' => ['admin.shop.take.stock.index'], 'method' => 'get', 'id' => 'base-form','class'=>'form-horizontal'] ) !!}
            <div class="panel-body">
                <div class="row">
                    <div class="col-md-6">
                        <div class="col-sm-6" style="padding-left: 0">
                            <div class="input-group date form_datetime">
                                        <span class="input-group-addon">
                                            <i class="fa fa-calendar"></i>&nbsp;&nbsp;盘点时间</span>
                                <input type="text" class="form-control inline" name="stime"
                                       value="{{request('stime')}}" placeholder="开始 " readonly>
                                <span class="add-on"><i class="icon-th"></i></span>
                            </div>
                        </div>
                        <div class="col-sm-6" style="padding-left: 0">
                            <div class="input-group date form_datetime">
                                        <span class="input-group-addon" style="cursor: pointer">
                                            <i class="fa fa-calendar"></i></span>
                                <input type="text" class="form-control" name="etime" value="{{request('etime')}}"
                                       placeholder="截止" readonly>
                                <span class="add-on"><i class="icon-th"></i></span>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group">
                            <input type="text" name="code" value="{{request('code')}}" placeholder="单号"
                                   class=" form-control"> <span
                                    class="input-group-btn">
                                        <button type="submit" class="btn btn-primary">查找</button></span></div>
                    </div>
                    <div class="col-md-2">
                        <a class="btn btn-primary" href="{{ route('admin.shop.take.stock.create') }}" no-pjax>新增盘点单</a>
                    </div>

                </div>

                {!! Form::close() !!}

                <div class="hr-line-dashed"></div>

                <div class="table-responsive">
                    @if($lists && $lists->count()>0)
                        <table class="table table-hover table-striped">
                            <tbody>
                            <!--tr-th start-->
                            <tr>
                                <th>盘点单号</th>
                                <th>盘点时间</th>
                                <th>操作人员</th>
                                <th>操作</th>
                            </tr>
                            <!--tr-th end-->
                            @foreach ($lists as $item)
                                <tr>
                                    <td>{{$item->code}}</td>
                                    <td>{{$item->created_at}}</td>
                                    <td>{{$item->clerk->name}}</td>
                                    <td>
                                        <a href="{{route('admin.shop.take.stock.show',['id'=>$item->id])}}" class="btn btn-xs btn-success">
                                            <i class="fa fa-eye" data-toggle="tooltip" data-placement="top" title="查看记录"></i>
                                        </a>
                                    </td>
                                </tr>
                            @endforeach

                            </tbody>
                            <tfoot>
                            <tr>
                                <td colspan="4" class="footable-visible">
                                    {!! $lists->render() !!}
                                </td>
                            </tr>
                            </tfoot>
                        </table>
                    @else
                        <div>
                            &nbsp;&nbsp;&nbsp;当前无数据
                        </div>
                    @endif
                </div><!-- /.box-body -->
            </div>
        </div>
    </div>
</div>


{!! Html::script(env("APP_URL").'/assets/backend/libs/datepicker/bootstrap-datetimepicker.js') !!}
{!! Html::script(env("APP_URL").'/assets/backend/libs/datepicker/bootstrap-datetimepicker.zh-CN.js') !!}

<script>
    $.getScript('{{env("APP_URL").'/assets/backend/libs/datepicker/bootstrap-datetimepicker.js'}}', function () {
	    $.fn.datetimepicker.dates['zh-CN'] = {
		    days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],
		    daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"],
		    daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"],
		    months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
		    monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
		    today: "今天",
		    suffix: [],
		    meridiem: ["上午", "下午"]
	    };

	    $('.form_datetime').datetimepicker({
		    language: 'zh-CN',
		    weekStart: 1,
		    todayBtn: 1,
		    autoclose: 1,
		    todayHighlight: 1,
		    startView: 2,
		    forceParse: 0,
		    showMeridian: 1,
		    minuteStep: 1
	    });

    });
</script>